package com.zhihuishu.micro.course.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.zhihuishu.micro.course.dao.CcCourseMapper;
import com.zhihuishu.micro.course.dao.CourseTimePlanMapper;
import com.zhihuishu.micro.course.dao.TblCourseMapper;
import com.zhihuishu.micro.course.model.CourseTimePlan;
import com.zhihuishu.micro.course.model.TblCourse;
import com.zhihuishu.micro.course.service.CourseManagementService;

@Service("courseManagementService")
public class CourseManagementServiceImpl extends BaseService implements CourseManagementService {
	
	@Resource
	private TblCourseMapper tblCourseMapper ;
	@Resource
	private CcCourseMapper ccCourseMapper ;
	@Resource
	private CourseTimePlanMapper courseTimePlanMapper ;
	
	

	@Override
	public Integer findCourseDtoTotalCount(String keywords, Long userId) {
		return tblCourseMapper.findCourseDtoTotalCount(keywords, userId);
	}

	@Override
	public List<TblCourse> findPageCourseDtos(String keywords, int pageNo,int pageSize, Long userId) {
		int firstResult = pageNo*pageSize;
		return tblCourseMapper.findPageCourseDtos(keywords, firstResult, pageSize, userId);
	}

	@Override
	public List<CourseTimePlan> findCourseTimePlanByCourseId(Long courseId) {
		
		return courseTimePlanMapper.findCourseTimePlanByCourseId(courseId);
	}

	@Override
	public TblCourse findCourseOpenByCourseId(Long courseId) {
		
		return tblCourseMapper.findCourseOpenByCourseId(courseId);
	}

	@Override
	public List<Map<String, Object>> getcourseTimePlanUpdateTimeByCourseIds(List<Long> courseIds) {
		return courseTimePlanMapper.getcourseTimePlanUpdateTimeByCourseIds(courseIds);
	}


	
}
